//
//  LYDataBaseMigrateManager.h
//  Apps
//
//  Created by 李永彬 on 2019/6/5.
//  Copyright © 2019 appscomm. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "LYDBMigrateStepProtocol.h"

NS_ASSUME_NONNULL_BEGIN

@protocol LYDataBaseMigrateManagerDelegate <NSObject>

@optional
@property (strong, nonatomic) NSArray < id<LYDBMigrateStepProtocol>> *databaseMigrateSteps;
@end

@interface LYDataBaseMigrateManager : NSObject

- (instancetype)initWithDatabase:(LYDatabase *)database delegate:(id <LYDataBaseMigrateManagerDelegate> )delegate;

- (void)startMigrateWithProgressHandler:(void(^)(NSProgress *progress))progressHandler completion:(void(^)(void))completion;

- (void)startAsyncMigrateWithProgressHandler:(void(^)(NSProgress *progress))progressHandler completion:(void(^)(void))completion;

@property (weak, nonatomic) id <LYDataBaseMigrateManagerDelegate> delegate;
@property (strong, nonatomic) LYDatabase *database;

- (void)setDBVersion:(NSInteger)dbVersion;

- (NSInteger)DBVersion;

@end

NS_ASSUME_NONNULL_END
